const {Position} = require("./model.js");

const PositionDao = {
	save(positionInfo){
		return new Position(positionInfo).save();
	},
	findByPage(page){
		const
			pageSize = 5,
			_skip = (page-1)*pageSize;
		return Position.find().limit(pageSize).skip(_skip);
	},
	update(condition,result){
		return Position.update(condition,result);
	},
	delete(condition){
		return Position.remove(condition);
	}
}
module.exports = PositionDao;